package lesson07;

import java.util.Timer;
import java.util.TimerTask;

public class Demo_701 {
    public static void main(String[] args) throws InterruptedException {
//        Timer timer=new Timer();
//        System.out.println("000");
//        timer.schedule(new TimerTask() {
//            @Override
//            public void run() {
//                System.out.println("1");
//            }
//        },3000);

        MyTimer myTimer=new MyTimer();
        myTimer.schedule(()->{
            System.out.println("起床");
        },1000);
        myTimer.schedule(()->{
            System.out.println("工作1");
        },2000);
        myTimer.schedule(()->{
            System.out.println("工作2");
        },3000);
    }
}
